﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using sixgod.Enum;
using SqlSugar;

namespace sixgod.Model.WorkFlowTemplate
{
    /// <summary>
    /// 流程模板主表
    /// </summary>
    [SugarTable("WorkFlowTemplate")]
    public class WorkFlowTemplate:ModelBase
    {
        /// <summary>
        /// 流程名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 类型 字典
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string? Remark{get;set; }

        /// <summary>
        /// 流程等级
        /// </summary>
        public EnumWorkFlowLevel Level { get; set; }

        /// <summary>
        /// 是否所有人可发起
        /// </summary>
        public bool AnyOneCanStart { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Status { get; set; } = false;

        /// <summary>
        /// 流程是否设计完成
        /// </summary>
        public bool IsDesigned { get; set; } = false;


        /// <summary>
        /// 模型数据验证
        /// </summary>
        /// <returns></returns>
        public override (bool, string) Verify()
        {
            return (true, null);
        }

        public override void Create(string creator)
        {
            IsDesigned = false;
            Status = false;

            base.Create(creator);
        }
    }
}
